﻿@model IEnumerable<HMoPro.Models.browselistModel>
<script   type="text/javascript">
    var datazip;
    var resourceid;
    function look(obj) {
        datazip = obj.id;
        //datazip = obj.data-zip;
        resourceid = $('#'+datazip).attr("data-res");
       var aa = window.location.host;
        $.ajax({
            url: "@Url.Action("QRcode")",
            data: { "resourceid": resourceid, "datazip": datazip, "url": aa },
                dataType: "json",
                type: "POST",
                success: function (data) {
                    //    $("#dianzan").attr('disabled', true);
                    
                    //resourceid, datazip, inboxname
                    window.open("@Url.Action("QRcodeImage")"+"?resourceid="+data.resourceid+"&datazip="+data.datazip+"&inboxname="+data.inboxname);

                    @*   window.location.href ="@Url.Action("QRcodeImage")"+"?resourceid="+'@Model.resourceid';*@
                }
            });




        // this.style.color = "red";
        //   $("#categorylist").remove(obj.id);
    }
    //变量名中多了空格，倒置调试了半天
</script>
<div style="overflow:hidden">
    <ul class="pull-right">
        @foreach (var item in Model)
        {
            if(item.viewname=="网页端"){
            <li style="display:inline-block;text-align:center;padding-top:10px;">
                <a href="#" target="_blank" class="test" onclick="look(this); return false;" id="@item.resourcezipid" data-res="@item.resourceid"  style="display: inline-block; width: 40px; padding-top: 34px; background-repeat: no-repeat; background-position-x:center;"> @item.viewname </a>
               @* ../../Uploads/@item.resourceid/@item.resourcezipid/@item.inboxname/index.html*@
            </li>
        }
        else {        
           <li style="display:inline-block;text-align:center;padding-top:10px;">
                <a href="../../Uploads/@item.resourceid/@item.zipname" target="_blank" class="test" style="display: inline-block; width: 40px; padding-top: 34px; background-repeat: no-repeat; background-position-x:center;"> @item.viewname </a>
            </li>}
        }
        @*<a href='#' class="btn btn-info btn-xs" onclick="look(this); return false;" id="@item.resourcezipid" data-res="@item.resourceid">手机看</a></span>*@
    </ul>
    <h3 class="pull-right">支持平台 </h3>

</div>

<script>
    var aryName = [{ txt: "网页", img: "show1" }, { txt: "手机", img: "show2" }, { txt: "电脑", img: "show3" }];
    $(document).ready(function () {
        var i=0;
        $(".test").each(function () {
            $(this).text(aryName[i].txt);
            alert
            $(this).css("background-image", "url(../../Images/" + aryName[i].img + ".png)");
            i++;
        });
    });
</script>